using System;
using System.Collections;

using VCDepend.Engine;

namespace VCDepend.Tests.Stubs
{
	public class StubProjectParser : IProjectParser
	{
		private ArrayList m_projects;
		private int m_current;

    private string m_lastProjectId;
		private string m_lastPath;
		private string m_lastConfiguration;

		public StubProjectParser()
		{
			m_projects = new ArrayList();
			m_current = 0;

      m_lastProjectId = string.Empty;
      m_lastPath = string.Empty;
      m_lastConfiguration = string.Empty;
		}

		public Project ParseProject(string projectId, string path, string configuration)
		{
      m_lastProjectId = projectId;
			m_lastPath = path;
			m_lastConfiguration = configuration;

			return (Project)m_projects[m_current++];
		}

		public void AddProject(Project project)
		{
			m_projects.Add(project);
		}

    public string LastProjectId
    {
      get
      {
        return m_lastProjectId;
      }
    }

		public string LastPath
		{
			get
			{
				return m_lastPath;
			}
		}

		public string LastConfiguration
		{
			get
			{
				return m_lastConfiguration;
			}
		}
	}
}
